using System;
using UnityEngine;
public class SComValuesVEx:IVEx
{
public void SetData(ComponentData d){Debug.Assert(TargetType.IsAssignableFrom(d.ComponentType));_data=new WeakReference<ComponentData>(d);}
public SComValuesVEx(ComponentData d){SetData(d);}
public SComValuesVEx(){}
WeakReference<ComponentData> _data;
public UInt32 CompIdentity{get{if(_data.TryGetTarget(out ComponentData data))return data.CompIdentity;else throw new NullReferenceException("弱引用未找到");}}
public  Type TargetType=>typeof(SComValues);
public ComponentData Data{get{if(_data.TryGetTarget(out ComponentData data))return data;
else throw new NullReferenceException("弱引用未找到");}}
public System.Int32 Blood {get{if(_data.TryGetTarget(out ComponentData data))return data.GetValue<System.Int32>(0);else throw new NullReferenceException("弱引用未找到");}
set{if(_data.TryGetTarget(out ComponentData data))data.SetValue<System.Int32>(0,value,true);else throw new NullReferenceException("弱引用未找到");}}
public static ushort BloodId{get=>(ushort)0;}
public System.Int32 Defence {get{if(_data.TryGetTarget(out ComponentData data))return data.GetValue<System.Int32>(1);else throw new NullReferenceException("弱引用未找到");}
set{if(_data.TryGetTarget(out ComponentData data))data.SetValue<System.Int32>(1,value,true);else throw new NullReferenceException("弱引用未找到");}}
public static ushort DefenceId{get=>(ushort)1;}
public System.Int32 MagicDefence {get{if(_data.TryGetTarget(out ComponentData data))return data.GetValue<System.Int32>(2);else throw new NullReferenceException("弱引用未找到");}
set{if(_data.TryGetTarget(out ComponentData data))data.SetValue<System.Int32>(2,value,true);else throw new NullReferenceException("弱引用未找到");}}
public static ushort MagicDefenceId{get=>(ushort)2;}
public System.Int32 Mass {get{if(_data.TryGetTarget(out ComponentData data))return data.GetValue<System.Int32>(3);else throw new NullReferenceException("弱引用未找到");}
set{if(_data.TryGetTarget(out ComponentData data))data.SetValue<System.Int32>(3,value,true);else throw new NullReferenceException("弱引用未找到");}}
public static ushort MassId{get=>(ushort)3;}
public System.Int32 Sharpness {get{if(_data.TryGetTarget(out ComponentData data))return data.GetValue<System.Int32>(4);else throw new NullReferenceException("弱引用未找到");}
set{if(_data.TryGetTarget(out ComponentData data))data.SetValue<System.Int32>(4,value,true);else throw new NullReferenceException("弱引用未找到");}}
public static ushort SharpnessId{get=>(ushort)4;}
public ElementState ElementState {get{if(_data.TryGetTarget(out ComponentData data))return data.GetValue<ElementState>(5);else throw new NullReferenceException("弱引用未找到");}
set{if(_data.TryGetTarget(out ComponentData data))data.SetValue<ElementState>(5,value,true);else throw new NullReferenceException("弱引用未找到");}}
public static ushort ElementStateId{get=>(ushort)5;}

}
